package com.sonicboom.nurun.dao;

import net.sourceforge.argparse4j.inf.ArgumentParserException;

public enum LifeStyle {
    inspire(1, "灵感"),
    fashion(2, "时尚"),
    music(3, "音乐"),
    art(4, "艺术"),
    mix(5, "混调");
    private final int code;
    private final String name;

    LifeStyle(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }


    public static LifeStyle parseFromCode(String code) {

        for (LifeStyle lifeStyle : LifeStyle.values()) {
            if (code.equals(String.valueOf(lifeStyle.getCode()))) {
                return lifeStyle;
            }
        }

        throw new IllegalArgumentException(code);
    }
}
